package cn.sunxyz.base.logicgate;

import cn.sunxyz.base.common.BoolPair;

/**
 * Created by yangrd on 2017/6/28.
 */
public class LogicGate {


    public static boolean and(boolean t1, boolean t2) {
        return t1 && t2;
    }

    public static boolean or(boolean t1, boolean t2) {
        return t1 || t2;
    }

    public static boolean nAnd(boolean t1, boolean t2) {
        return !(t1 && t2);
    }

    public static boolean nOr(boolean t1, boolean t2) {
        return !(t1 || t2);
    }

    public static boolean xOr(boolean t1, boolean t2) {
        return t1 != t2;
    }


    @FunctionalInterface
    public interface Logic<T> {
        T operation(T t1, T t2);
    }
}
